package leetcode_core.test;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

/**
 * 功能描述
 *
 * @author: 张庭杰
 * @date: 2022年10月15日 15:52
 */
public class UDPServer {
    public static void main(String[] args) throws Exception {
        DatagramSocket server = new DatagramSocket(8000);
        String message = "123456";
        DatagramPacket packet = new DatagramPacket(message.getBytes(),0,message.length(),
                InetAddress.getByName("localhost"),9999);
        server.send(packet);
        server.close();
    }
}
